<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8" isELIgnored="false"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>

<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<base href="<%=basePath%>" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>MenuDetail</title>
<link rel="stylesheet" href="css/bootstrap.min.css" type="text/css"
	media="all">
<link rel="stylesheet" href="css/font-awesome.min.css" type="text/css"
	media="all" />
<link rel="stylesheet" href="css/ionicons.min.css" type="text/css"
	media="all" />
<link rel="stylesheet" href="css/owl.carousel.css" type="text/css"
	media="all">
<link rel="stylesheet" href="css/owl.theme.css" type="text/css"
	media="all">
<link rel='stylesheet' href='css/prettyPhoto.css' type='text/css'
	media='all'>
<link rel='stylesheet' href='css/slick.css' type='text/css' media='all'>
<link rel="stylesheet" href="css/style.css" type="text/css" media="all">
<link rel="stylesheet" href="css/custom.css" type="text/css" media="all">
<link
	href="http://fonts.googleapis.com/css?family=Great+Vibes%7CLato:100,100i,300,300i,400,400i,700,700i,900,900i"
	rel="stylesheet">
</head>
<body>
<script type="text/javascript">
function addwish(DishId){
	var c_id=$("#cid").val();
	if(c_id==null||c_id=="")
		{alert("请先登录！！");}
	else{
		var wishdata={
				DishId:DishId,
				c_id:c_id
		};
		$.ajax({
			type:"POST",
			data:wishdata,
			url :'menu/addtowish.do',
			error : function(request) {
				alert("请求异常!!!");
			},
			success : function(data) {
				alert("添加成功!");
				window.location.reload();
			}
		});
	}
}
function addtocart(DishId){
	window.location.href="addCart.do?DishId="+DishId;
}
</script>
	<div class="site">

		<div id="main">

			<div class="section border-bottom pt-2 pb-2">
				<div class="container">
					<div class="row">
						<div class="col-sm-12">
							<ul class="breadcrumbs">
								<li><a href="menu/recommand.do">首页</a></li>
								<li>菜品详情</li>
							</ul>
						</div>
					</div>
				</div>
			</div>
			<c:forEach items="${menuinfolist }" var="mifl">
				<div class="section pt-7 pb-7">
					<div class="container">
						<div class="row">
							<div class="single-product">
								<div class="col-md-6">
									<div class="image-gallery">
										<div class="image-gallery-inner">

											<div>
												<div class="image-thumb">
													<img src="upimg/${mifl.dishPicture }" alt="图片加载中.." style="width:500px;height:400px"/>
												</div>
											</div>

										</div>
									</div>

								</div>

								<div class="col-md-6">
									<div class="summary">
										<h1 class="product-title">商品名称:${mifl.dishName }</h1>
										<div class="product-rating">
											<div class="star-rating">
												<span style="width: 100%"></span>
											</div>
										</div>
										<div class="product-price">
											<!-- <del>$15.00</del> -->
											<ins>￥${mifl.dishPrice }元/份</ins>
										</div>
										
<!-- 											<div class="quantity-chooser"> -->
<!-- 												<div class="quantity"> -->
<!-- 													<span class="qty-minus" data-min="1"><i -->
<!-- 														class="ion-ios-minus-outline"></i></span> <input type="text" -->
<!-- 														name="quantity" value="1" title="Qty" -->
<!-- 														class="input-text qty text" size="4"> <span -->
<!-- 														class="qty-plus" data-max=""> <i -->
<!-- 														class="ion-ios-plus-outline"></i></span> -->
<!-- 												</div> -->
<!-- 											</div> -->
											<button  class="single-add-to-cart" onclick="addtocart(${mifl.dishId })" style="width:300px;height:50px">添加到购物车</button>
											<button  class="single-add-to-cart" onclick="addwish(${mifl.dishId })" style="width:300px;height:50px">收藏</button>
									
										
										<div class="product-meta">
											<table>
												<tbody>
													<tr>
														<td class="label">种类</td>
														<td><a>${mifl.menuClassname }</a></td>
													</tr>
		
												</tbody>
											</table>
										</div>
									</div>
								</div>
<input type="hidden" value="${custom.c_id }" id="cid">

								<div class="col-md-12">
									<div class="commerce-tabs tabs classic">
										<ul class="nav nav-tabs tabs">
											<li class="active"><a data-toggle="tab"
												href="#tab-description" aria-expanded="true">描述</a></li>
											<li class=""><a data-toggle="tab" href="#tab-reviews"
												aria-expanded="false">评论</a></li>
										</ul>
										<div class="tab-content">
											<div class="tab-pane fade active in" id="tab-description">
												<p>${mifl.dishDescribe }</p>
											</div>
											<div id="tab-reviews" class="tab-pane fade">
												<div class="single-comments-list mt-0">
													<div class="mb-2">
														<h2 class="comment-title"></h2>
													</div>
													<ul class="comment-list">
													<c:set var="count" value="0"></c:set>
														<c:forEach items="${reviewbean }" var="bean">
															<li>
																<div class="comment-container">
																	<div class="comment-author-vcard">
																		<img alt="" src="images/avatar/avatar.png" />
																	</div>

																	<div class="comment-author-info">
																		<span class="comment-author-name">${bean.c_name}</span>
																		<a href="#" class="comment-date">${bean.rdate }</a>
																		<p>${bean.content }</p>
																		<c:set var="count" value=" ${bean.c_reviewid}"></c:set>
																	</div>
																	<div class="reply">
																		<input type="button" class="btn btn-primary btn-lg"
																			data-toggle="modal" data-target="#myModal"  value="回复"/>
																			
																	</div>
																</div>

																<ul class="children">
																	<c:forEach items="${revicereview}" var="review">
																		<c:if test="${review.rev_c_reviewid==bean.c_reviewid}">
																			<li>
																				<div class="comment-container">
																					<div class="comment-author-vcard">
																						<img alt="" src="images/avatar/avatar.png" />
																					</div>
																					<div class="comment-author-info">
																						<span class="comment-author-name">${review.c_name }</span>
																						<a href="#" class="comment-date">${reiew.tdate }</a>
																						<p>${review.content }</p>
																					</div>
																				</div>
																			</li>
																		</c:if>
																	</c:forEach>
																</ul>
															</li>
														</c:forEach>
													</ul>
												</div>

												<div class="single-comment-form mt-0">
													<div class="mb-2">
														<h2 class="comment-title">评论</h2>
													</div>
													<form class="comment-form" action="menu/reviewIns.do">
														<div class="col-md-6">
															评论类别：<br> <select name="Reviewclassid"
																id="Reviewclassid">
																<option value="">请选择...</option>
																<c:forEach items="${reviewclass }" var="reviewclass">
																	<option value="${reviewclass.reviewclassid }">${reviewclass.reviewclassname }</option>
																</c:forEach>
															</select>
														</div>
														<br>
														<div class="row">
															<div class="col-md-12">
																<textarea id="Content" name="Content" cols="45" rows="5"
																	placeholder="评论内容"></textarea>
															</div>
														</div>
														<div class="row">
															<div class="col-md-2">
																<input name="submit" type="submit" id="submit"
																	class="btn btn-alt btn-border" value="发布">
															</div>
														</div>
													</form>
												</div>
											</div>
										</div>
									</div>
								</div>
							</div>
						</div>
					</div>

				</div>

			</c:forEach>
		
		</div>
	</div>

	<div class="modal fade" id="myModal" tabindex="-1" role="dialog"
		aria-labelledby="myModalLabel" aria-hidden="true">
		<div class="modal-dialog">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal"
						aria-hidden="true">&times;</button>
					<h4 class="modal-title" id="myModalLabel">回复评论</h4>
				</div>
				<form action="menu/reviewReply.do" method="post">
					<div class="modal-body">
					<input type="hidden" name="rev_c_reviewid" id="revreviewid" value="${count }">
						<textarea id="Content" name="Content" cols="45" rows="5"
							placeholder="评论内容"></textarea>
					</div>
				
				<div class="modal-footer">
					<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
					<input name="submit" type="submit" id="submit"
						class="btn btn-alt btn-border" value="发布">
				</div>
				</form>
			</div>
			<!-- /.modal-content -->
		</div>
		<!-- /.modal -->
	</div>
	<script type="text/javascript" src="js/jquery.min.js"></script>
	<script type="text/javascript" src="js/jquery-migrate.min.js"></script>
	<script type="text/javascript" src="js/bootstrap.min.js"></script>
	<script type="text/javascript" src="js/modernizr-2.7.1.min.js"></script>
	<script type="text/javascript" src="js/owl.carousel.min.js"></script>
	<script type="text/javascript" src="js/jquery.countdown.min.js"></script>
	<script type='text/javascript' src='js/jquery.prettyPhoto.js'></script>
	<script type='text/javascript' src='js/jquery.prettyPhoto.init.min.js'></script>
	<script type='text/javascript' src='js/slick.min.js'></script>
	<script type="text/javascript" src="js/script.js"></script>
</body>
</html>